Spread Windows Forms 17
GrapeCity.Spreadsheet Assembly / GrapeCity.Spreadsheet Namespace / DataValidations Class / Add Method / Add(Reference[],DataValidationType,DataValidationErrorStyle,DataValidationOperator,String,String) Method
An array of Reference indicates the references of this DataValidation.
A DataValidationType value indicates the type of data validation to add.
A DataValidationErrorStyle value indicates the error style to use for error messages.
A string value indicates the first data validation value, formula or list.
A string value indicates the second data validation value for DataValidationOperator.Between or DataValidationOperator.NotBetween.


In This Topic
    Add(Reference[],DataValidationType,DataValidationErrorStyle,DataValidationOperator,String,String) Method
    In This Topic
    Adds data validation to the specified range.
    Syntax
    'Declaration
     
    
    Public Overloads Function Add( _
       ByVal rangeRefs() As Reference, _
       ByVal type As DataValidationType, _
       ByVal errorStyle As DataValidationErrorStyle, _
       ByVal operator As DataValidationOperator, _
       ByVal formula1 As String, _
       Optional ByVal formula2 As String _
    ) As DataValidation
    'Usage
     
    
    Dim instance As DataValidations
    Dim rangeRefs() As Reference
    Dim type As DataValidationType
    Dim errorStyle As DataValidationErrorStyle
    Dim operator As DataValidationOperator
    Dim formula1 As String
    Dim formula2 As String
    Dim value As DataValidation
     
    value = instance.Add(rangeRefs, type, errorStyle, operator, formula1, formula2)

    Parameters

    rangeRefs
    An array of Reference indicates the references of this DataValidation.
    type
    A DataValidationType value indicates the type of data validation to add.
    errorStyle
    A DataValidationErrorStyle value indicates the error style to use for error messages.
    operator
    formula1
    A string value indicates the first data validation value, formula or list.
    formula2
    A string value indicates the second data validation value for DataValidationOperator.Between or DataValidationOperator.NotBetween.

    Return Value

    A DataValidation instance represents the created data validation. null if the data is invalid.
    Remarks
    All existed data validations in the specified range will be removed.
    See Also